load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "backfill",
    srcs = [
        "backfill.go",
        "index_backfiller_cols.go",
        "mvcc_index_merger.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/backfill",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/fetchpb",
        "//pkg/sql/catalog/schemaexpr",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/isql",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/row",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowinfra",
        "//pkg/sql/sem/catid",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/transform",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sqlerrors",
        "//pkg/sql/types",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/ctxgroup",
        "//pkg/util/hlc",
        "//pkg/util/intsets",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
    ],
)

go_test(
    name = "backfill_test",
    srcs = [
        "index_backfiller_cols_test.go",
        "mvcc_index_merger_test.go",
    ],
    embed = [":backfill"],
    deps = [
        "//pkg/kv",
        "//pkg/roachpb",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/sem/catid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
